<h2 class="panel-title">{{"funds.deposit_cny.title" | t}}</h2>
<div class="help-block">
  {{ "funds.deposit_cny.desc" | t }}
  <ul>
    <li>{{ "funds.deposit_cny.desc_item_1" | t }}</li>
    <li>{{ "funds.deposit_cny.desc_item_2" | t }} </li>
    <li>{{ "funds.deposit_cny.desc_item_3" | t }}</li>
  </ul>
  <span class="text-danger">{{ "funds.deposit_cny.attention" | t }}</span>
</div>

<form id="cny_deposit" name="deposit_form" class="form form-horizontal transfer-form" ng-controller="DepositsController as depositsCtrl" ng-submit="deposit_form.$valid && depositsCtrl.createDeposit(currency)" novalidate>

  <table class="table">
    <tr>
      <td rowspan="3" class="v-col">{{ "funds.deposit_cny.from" | t }}</td>
      <td><label class="optional control-label">{{ "funds.deposit_cny.deposit_name" | t }}</label><p class="form-control-static">{{name}}</p></td>
      <td rowspan="3" class="v-col">{{ "funds.deposit_cny.to" | t }}</td>
      <td><label class="optional control-label">{{ "funds.deposit_cny.to_name" | t }}</label><p class="form-control-static">邱亮</p></td>
    </tr>
    <tr>
      <td>
        <label class="select required control-label" for="deposit_fund_source">{{"funds.deposit_cny.deposit_account" | t}} (<a href="javascripts:;" ng-click="openFundSourceManagerPanel()">{{ "funds.deposit_cny.manage" | t }}</a>)</label>
        <select id="fund_source" class="select required form-control" name="fund_source"
          ng-model="depositsCtrl.deposit.fund_source"
          ng-options="fs.id as fs.label for fs in fund_sources | filter:{currency:currency}"
          required>
        </select>
      </td>
      <td><label class="optional control-label">{{"funds.deposit_cny.to_account" | t}}</label><p class="form-control-static">6214 8501 0176 3297</p></td>
    </tr>
    <tr class="last-row">
      <td><label class="optional control-label">{{ "funds.deposit_cny.amount" | t}}</label><input class="form-control" id="deposit_sum" name="deposit[sum]" placeholder="{{'funds.deposit_cny.min_amount' | t}}" type="number" min="100" ng-model="depositsCtrl.deposit.amount" required></td>
      <td class="row">
        <span class="col-md-12"><label class="optional control-label">{{ "funds.deposit_cny.to_bank_name" | t }}</label><p class="form-control-static">招商银行</p></span>
        <span class="col-md-12"><label class="optional control-label">{{ "funds.deposit_cny.opening_bank_name" | t }}</label><p class="form-control-static">北京双榆树支行</p></span>
      </td>
    </tr>
  </table>

  <div class="form-group">
    <div class="form-submit">
      <input class="btn btn-primary" data-loading-text="Creating..." name="commit" type="submit" value="{{'submit' | t}}">
    </div>
  </div>

</form>

<br>
<h2 class="panel-title">{{ "funds.deposit_history.title" | t }}</h2>
<table class="table" ng-controller="DepositHistoryController as dhCtrl">
  <tr>
    <th>{{ "funds.deposit_history.identification" | t }}</th>
    <th>{{ "funds.deposit_history.time" | t }}</th>
    <th>{{ "funds.deposit_history.from" | t }}</th>
    <th>{{ "funds.deposit_history.amount" | t }}</th>
    <th>{{ "funds.deposit_history.state_and_action" | t }}</th>
  </tr>
  <tr class="deposit_item" ng-class="{ 'new-row':dhCtrl.newRecord(deposit) }" ng-repeat="deposit in dhCtrl.deposits | orderBy:predicate">
    <td><span class="outlined-label">{{deposit.id}}</span></td>
    <td>{{deposit.created_at | date:'yyyy-MM-dd HH:mm' }}</td>
    <td>{{deposit.fund_extra}} @ {{deposit.fund_uid}}</td>
    <td>{{deposit.amount}}</td>
    <td>{{"funds.deposit_history." + deposit.aasm_state | t}}
      <span ng-if="dhCtrl.canCancel(deposit.aasm_state)">/
        <a ng-click="dhCtrl.cancelDeposit(deposit); $event.preventDefault()" href="#" class="cancel_link">{{ "funds.deposit_history.cancel" | t }}</a>
      </span>
    </td>
  </tr>
  <tr ng-show="dhCtrl.canCancel(deposit.aasm_state)"><td colspan="6"><span class="help-block text-center">{{ "funds.deposit_history.no_data" | t }}</span></td></tr>
</table>

